package net.whg.controller;


import net.whg.service.TrafficService;
import net.whg.util.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author whg
 * @since 2024-12-06
 */
@RestController
@RequestMapping("/api/v1/traffic")
public class TrafficController {

    @Autowired
    private TrafficService trafficService;

    @GetMapping("save")
    public JsonData save(){
        trafficService.save();
        return JsonData.buildSuccess();
    }

    @GetMapping("list1")
    public JsonData list1(){
        return JsonData.buildSuccess(trafficService.list1());
    }

    @GetMapping("list2")
    public JsonData list2(){
        return JsonData.buildSuccess(trafficService.list2());
    }


}

